package cn.hnu.jpa.jpaExample.OneWayAssociation;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

import org.junit.Test;

public class UnitTest {

//	@Test
	public void test() {
		EntityManagerFactory emf = Persistence.createEntityManagerFactory("jpa");
		EntityManager em = emf.createEntityManager();
		em.getTransaction().begin();
		Person cpk = new Person();
		Address addr = new Address();
		addr.setAddr("1111111");
		cpk.setName("zdc");
		cpk.setAddr(addr);
		em.persist(cpk);
		em.getTransaction().commit();
		em.close();
		emf.close(); 
	}

}
